import request from '@/utils/requist'

// 首页全局数据
export const articleAPI = () => {
  return request({
    url: '/index/index'
  })
}

// 获取数据详情
export const articledetailAPI = data => {
  return request({
    url: '/index/show',
    data: { id: data }
  })
}

// 图片文件上传
export const phontoPostAPI = data => {
  return request({
    method: 'POST',
    url: '/common/upload?type=images',
    data: data
  })
}

// 发布文章
export const releaseAPI = data => {
  return request({
    method: 'POST',
    url: '/user/addArticle',
    data: data
  })
}

// 获取分类数据列表
export const pagelist = id => {
  return request({
    url: 'http://124.223.14.236:8060/home/index/list',
    params: {
      page: 1,
      limit: 20,
      cateid: id
    }
  })
}
